From f8cfd44ff8672aa94bdb9c63f4f1c25111d4d4a4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 12 May 2006 08:37:07 +0000 Subject: [PATCH] Remove the error parameter to the gtk_recent_manager_add() and 2006-05-11 Emmanuele Bassi * gtk/gtkrecentmanager.h: Remove the error parameter to the gtk_recent_manager_add() and gtk_recent_manager_add_full() functions; remove the unneeded error codes from the error enumeration. (#336774). * gtk/gtkrecentmanager.c: Make gtk_recent_manager_add() and gtk_recent_manager_add_full() complain loudly about wrong or missing meta-data, instead of using a GError. (#336774) --- ChangeLog | 11 ++++++++ ChangeLog.pre-2-10 | 11 ++++++++ gtk/gtkrecentmanager.c | 58 +++++++++++++++--------------------------- gtk/gtkrecentmanager.h | 10 ++------ 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b5458bc7d..41a0dd869d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-05-11 Emmanuele Bassi + + * gtk/gtkrecentmanager.h: Remove the error parameter to the + gtk_recent_manager_add() and gtk_recent_manager_add_full() + functions; remove the unneeded error codes from the error + enumeration. (#336774). + + * gtk/gtkrecentmanager.c: Make gtk_recent_manager_add() and + gtk_recent_manager_add_full() complain loudly about wrong or + missing meta-data, instead of using a GError. (#336774) + 2006-05-11 Matthias Clasen * demos/gtk-demo/Makefile.am (demos): Add it here. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0b5458bc7d..41a0dd869d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +2006-05-11 Emmanuele Bassi + + * gtk/gtkrecentmanager.h: Remove the error parameter to the + gtk_recent_manager_add() and gtk_recent_manager_add_full() + functions; remove the unneeded error codes from the error + enumeration. (#336774). + + * gtk/gtkrecentmanager.c: Make gtk_recent_manager_add() and + gtk_recent_manager_add_full() complain loudly about wrong or + missing meta-data, instead of using a GError. (#336774) + 2006-05-11 Matthias Clasen * demos/gtk-demo/Makefile.am (demos): Add it here. diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index bf469dd6dc..371db0ff7a 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -812,7 +812,6 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager) * gtk_recent_manager_add_item: * @manager: a #GtkRecentManager * @uri: a valid URI - * @error: return location for a #GError, or %NULL * * Adds a new resource, pointed by @uri, into the recently used * resources list. @@ -831,8 +830,7 @@ gtk_recent_manager_get_limit (GtkRecentManager *manager) */ gboolean gtk_recent_manager_add_item (GtkRecentManager *manager, - const gchar *uri, - GError **error) + const gchar *uri); { GtkRecentData *recent_data; GError *add_error; @@ -873,7 +871,7 @@ gtk_recent_manager_add_item (GtkRecentManager *manager, recent_data->is_private = FALSE; add_error = NULL; - retval = gtk_recent_manager_add_full (manager, uri, recent_data, &add_error); + retval = gtk_recent_manager_add_full (manager, uri, recent_data); g_free (recent_data->mime_type); g_free (recent_data->app_name); @@ -881,13 +879,6 @@ gtk_recent_manager_add_item (GtkRecentManager *manager, g_slice_free (GtkRecentData, recent_data); - if (!retval) - { - g_propagate_error (error, add_error); - - return FALSE; - } - return retval; } @@ -896,7 +887,6 @@ gtk_recent_manager_add_item (GtkRecentManager *manager, * @manager: a #GtkRecentManager * @uri: a valid URI * @recent_data: metadata of the resource - * @error: return location for a #GError, or %NULL * * Adds a new resource, pointed by @uri, into the recently used * resources list, using the metadata specified inside the #GtkRecentData @@ -939,53 +929,47 @@ gtk_recent_manager_add_full (GtkRecentManager *manager, if ((data->display_name) && (!g_utf8_validate (data->display_name, -1, NULL))) { - g_set_error (error, GTK_RECENT_MANAGER_ERROR, - GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING, - _("The display name of the recently used resource " - "must be a valid UTF-8 encoded string.")); + g_warning ("Attempting to add `%s' to the list of recently used " + "resources, but the display name is not a valid UTF-8 " + "encoded string", + uri); return FALSE; } if ((data->description) && (!g_utf8_validate (data->description, -1, NULL))) { - g_set_error (error, GTK_RECENT_MANAGER_ERROR, - GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING, - _("The description of the recently used resource " - "must be a valid UTF-8 encoded string.")); + g_warning ("Attempting to add `%s' to the list of recently used " + "resources, but the description is not a valid UTF-8 " + "encoded string", + uri); return FALSE; } if (!data->mime_type) { - g_set_error (error, GTK_RECENT_MANAGER_ERROR, - GTK_RECENT_MANAGER_ERROR_INVALID_MIME, - _("You must specify the MIME type of the " - "resource pointed by `%s'"), - uri); + g_warning ("Attempting to add `%s' to the list of recently used " + "resources, but not MIME type was defined", + uri); return FALSE; } if (!data->app_name) { - g_set_error (error, GTK_RECENT_MANAGER_ERROR, - GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED, - _("You must specify the name of the application " - "that is registering the recently used resource " - "pointed by `%s'"), - uri); + g_warning ("Attempting to add `%s' to the list of recently used " + "resources, but no name of the application that is " + "registering it was defined" + uri); return FALSE; } if (!data->app_exec) { - g_set_error (error, GTK_RECENT_MANAGER_ERROR, - GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING, - _("You must specify a command line to " - "be used when launching the resource " - "pointed by `%s'"), - uri); + g_warning ("Attempting to add `%s' to the list of recently used " + "resources, but no command line for the application " + "that is registering it was defined", + uri); return FALSE; } diff --git a/gtk/gtkrecentmanager.h b/gtk/gtkrecentmanager.h index e85488c22c..c09deb2865 100644 --- a/gtk/gtkrecentmanager.h +++ b/gtk/gtkrecentmanager.h @@ -104,8 +104,6 @@ struct _GtkRecentManagerClass * @GTK_RECENT_MANAGER_ERROR_NOT_FOUND: the URI specified does not exists in * the recently used resources list. * @GTK_RECENT_MANAGER_ERROR_INVALID_URI: the URI specified is not valid. - * @GTK_RECENT_MANAGER_ERROR_INVALID_MIME: the MIME type specified is not - * valid. * @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: the supplied string is not * UTF-8 encoded. * @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: no application has registered @@ -122,10 +120,8 @@ typedef enum { GTK_RECENT_MANAGER_ERROR_NOT_FOUND, GTK_RECENT_MANAGER_ERROR_INVALID_URI, - GTK_RECENT_MANAGER_ERROR_INVALID_MIME, GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING, GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED, - GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING, GTK_RECENT_MANAGER_ERROR_READ, GTK_RECENT_MANAGER_ERROR_WRITE, GTK_RECENT_MANAGER_ERROR_UNKNOWN @@ -145,12 +141,10 @@ void gtk_recent_manager_set_screen (GtkRecentManager *manag GdkScreen *screen); gboolean gtk_recent_manager_add_item (GtkRecentManager *manager, - const gchar *uri, - GError **error); + const gchar *uri); gboolean gtk_recent_manager_add_full (GtkRecentManager *manager, const gchar *uri, - const GtkRecentData *recent_data, - GError **error); + const GtkRecentData *recent_data); gboolean gtk_recent_manager_remove_item (GtkRecentManager *manager, const gchar *uri, GError **error); -- 2.30.2